<template>
	<view class="friend-list u-f-ac"   @tap="openchat">
		<view class="friend-list-left">
			<image :src="item.userimg" mode="widthFix" lazy-load></image>
		</view>
		
		<view class="friend-list-center">
			{{item.username}}
			<view class="friend-list-sex">
				<tag-sex-age :userage="item.userage" :usersex="item.usersex"></tag-sex-age>
			</view>
			
		</view>
		<!-- 关注 -->
		<view v-if="tabIndex==2" class="friend-list-right u-f-ajc">
		
			<u-icon  name="heart-fill" color="#F98937" size="40"></u-icon>
		</view>
		<view  v-else class="friend-list-right u-f-ajc">
		
			<uni-icons type="checkbox-filled" color="#CCCCCC" size="20" />
		</view>
			
	</view>
</template>

<script>
		import tagSexAge from '../../components/common/tag-sex-age.vue'
	export default{
		components:{
			tagSexAge
		},
		props:{
			item:Object,
			tabIndex:Number
		},
		methods:{
			openchat(){
				uni.navigateTo({
					url:'../../pages/user-chat/user-chat'
				})
			}
		}
	}
</script>

<style scoped>
	.friend-list{
		position: relative;
		margin-left: 20upx;
		margin-right: 20upx;
		padding-top: 20upx;
		padding-bottom: 30upx;
		padding-left: 20upx;
		padding-right: 20upx;
		border-bottom: #EEEEEE 1upx solid;
		
	}
	.friend-list-left image {
		width: 100upx;
		height: 100upx;
		border-radius: 100%;
		margin-right: 30upx;
		flex-shrink: 0;
	}
	.friend-list-right{
		width: 70upx;
	}
	.friend-list-sex{
		margin-right: 5upx;
	}
	.friend-list-center{
		flex: 1;
	}
</style>
